package com.young.test.aop;

import javax.inject.Named;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

import com.young.test.customannotation.Brand;
import com.young.test.domain.Person;


@Named
@Aspect
public class SystemArchitecture {
	
	@Pointcut("execution(public void info())")
	public void infoOperation(){}
	
	@Pointcut("execution(public void init())")
	public void initOperation(){}
	
	@Pointcut("within(com.young.test.bean.*)")
	public void inBeanPackage(){}
	
	@Pointcut("bean(forAspectBean)")
	public void forAspectBeanOperation(){}
	
	@Pointcut("within(com.young.test.daos.*)")
	public void withinDaoLayer(){}
	
	@Pointcut("execution(public * *(..))")
	public void forAllPublicMethod(){}
	
	@Pointcut("execution(public void *(..))")
	public void forAllPublicVoidMethod(){}
	
	@Pointcut("execution(public com.young.test.domain.Person *(..))")
	public void forReturnPersonMethod(){}
	
	
	@Pointcut("withinDaoLayer() && forReturnPersonMethod() && args(name)")
	public void forReturnPersonByStringMethod(String name){}
	
	@Pointcut("forAllPublicVoidMethod() && @annotation(brand)")
	public void forAnnotationByBrandMethod(Brand brand){}
	
	@Pointcut("forAllPublicVoidMethod() && @within(brand)")
	public void forAnnotationByBrandType(Brand brand){}
	
	@Pointcut("execution(* sampleGenericMethod(..)) && args(person)")
	public void genericMethodByPerson(Person person){}
	
	@Pointcut("execution(* sampleGenericMethod(..)) && args(name)")
	public void genericMethodByString(String name){}
	
}
